Skip to content

Backport #2732: fix(next): respect basePath for workflow routes#2791

Open
github-actions[bot] wants to merge 3 commits into
stablefrom
backport/pr-2732-to-stable
Open

Backport #2732: fix(next): respect basePath for workflow routes#2791
github-actions[bot] wants to merge 3 commits into
stablefrom
backport/pr-2732-to-stable

Conversation

@github-actions

@github-actions github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Automated backport of #2732 to stable (backport job run).

AI recommendation: This is a self-contained bug fix (Fixes #1864) that makes workflow route/URL construction respect the framework basePath, touching packages that all exist on stable (@workflow/next, @workflow/core, @workflow/builders, @workflow/utils, @workflow/world-local, @workflow/world-postgres). It introduces a new shared route helper but does not depend on any main-only APIs, so it applies cleanly to the existing functionality on stable.

Merge conflicts were resolved by AI (opencode with anthropic/claude-opus-4.8). Please review the conflict resolution carefully before merging.

* fix(next): respect basePath for workflow routes

* docs(core): note workflow URL resolution gap

* fix(next): expose workflow health route methods

* test(utils): remove workflow route helper tests

* test(builders): remove route handler string test

* fix(next): defer basePath validation to Next.js

* refactor(utils): remove workflow url helper wrappers

* Test Next basePath builder wiring

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 31971e7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 21 packages
Name Type
@workflow/builders Patch
@workflow/astro Patch
@workflow/core Patch
@workflow/next Patch
@workflow/sveltekit Patch
@workflow/utils Patch
@workflow/world-local Patch
@workflow/world-postgres Patch
@workflow/cli Patch
@workflow/nest Patch
@workflow/nitro Patch
@workflow/rollup Patch
@workflow/vite Patch
@workflow/vitest Patch
workflow Patch
@workflow/web-shared Patch
@workflow/web Patch
@workflow/world-testing Patch
@workflow/errors Patch
@workflow/nuxt Patch
@workflow/world-vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
example-nextjs-workflow-turbopack Ready Ready Preview, Comment Jul 8, 2026 9:26pm
example-nextjs-workflow-webpack Ready Ready Preview, Comment Jul 8, 2026 9:26pm
example-workflow Ready Ready Preview, Comment Jul 8, 2026 9:26pm
workbench-astro-workflow Ready Ready Preview, Comment Jul 8, 2026 9:26pm
workbench-express-workflow Ready Ready Preview, Comment Jul 8, 2026 9:26pm
workbench-fastify-workflow Ready Ready Preview, Comment Jul 8, 2026 9:26pm
workbench-hono-workflow Ready Ready Preview, Comment Jul 8, 2026 9:26pm
workbench-nitro-workflow Ready Ready Preview, Comment Jul 8, 2026 9:26pm
workbench-nuxt-workflow Ready Ready Preview, Comment Jul 8, 2026 9:26pm
workbench-sveltekit-workflow Ready Ready Preview, Comment Jul 8, 2026 9:26pm
workbench-tanstack-start-workflow Ready Ready Preview, Comment Jul 8, 2026 9:26pm
workbench-vite-workflow Ready Ready Preview, Comment Jul 8, 2026 9:26pm
workflow-swc-playground Building Building Preview, Comment Jul 8, 2026 9:26pm
workflow-tarballs Ready Ready Preview, Comment Jul 8, 2026 9:26pm
workflow-web Ready Ready Preview, Comment Jul 8, 2026 9:26pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
workflow-docs Skipped Skipped Jul 8, 2026 9:26pm

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Suggestion:

SvelteKit and Astro workflow route builders use a regex matching the old generated handler format, so post-processing throws "Failed to wrap generated ... workflow route" after the generated code format changed.

Fix on Vercel

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

🧪 E2E Test Results

Some tests failed

Summary

Passed Failed Skipped Total
❌ ▲ Vercel Production 1066 11 78 1155
✅ 💻 Local Development 1174 0 86 1260
✅ 📦 Local Production 1174 0 86 1260
❌ 🐘 Local Postgres 1173 1 86 1260
✅ 🪟 Windows 105 0 0 105
❌ 🌍 Community Worlds 79 102 9 190
✅ 📋 Other 594 0 36 630
Total 5365 114 381 5860

❌ Failed Tests

▲ Vercel Production (11 failed)

astro (1 failed):

example (1 failed):

express (1 failed):

fastify (1 failed):

hono (1 failed):

nextjs-turbopack (1 failed):

nextjs-webpack (1 failed):

nitro (1 failed):

nuxt (1 failed):

sveltekit (1 failed):

vite (1 failed):

🐘 Local Postgres (1 failed)

sveltekit-stable (1 failed):

  • workflowAndStepMetadataWorkflow | wrun_01KX1T2EM0J82GC89A83KEQ8T1
🌍 Community Worlds (102 failed)

redis (19 failed):

  • hookWorkflow | wrun_01KX1T0033HMSTBHSG9ZJYCY5G
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KX1T092XD83FY7F9X5847XTY
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KX1T0KF0G0CF3HY2BSY0MPD2
  • sleepingWorkflow | wrun_01KX1T1KK73D4QEFY8HSAZT6JP
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KX1T9HP1A3KT7ASH0DRHBY36
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KX1T9XQVWG94TXACW42JJ5EZ
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KX1TA5NYHXACA433Q4JWZ012
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KX1TAKGMZJ0QJCG5MPTR5K8S
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KX1TBDJ2VM2VRW38F3JDGX9D
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KX1TBJNZ61VHWRQY8T3WW97T
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KX1TBRC6XWAYE8QNS266C802
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KX1TBXRY8296WF8MCNKGDA5F
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KX1TC67K0PDVB4P76AB2KG18
  • pages router sleepingWorkflow via pages router
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KX1THX1X0P49CYJJJB501RVG

turso (83 failed):

  • addTenWorkflow | wrun_01KX1SY5ZA9BVSZSM4DAW90AM8
  • addTenWorkflow | wrun_01KX1SY5ZA9BVSZSM4DAW90AM8
  • deploymentId: 'latest' is a no-op in non-Vercel worlds
  • wellKnownAgentWorkflow (.well-known/agent) | wrun_01KX1T05Z3F53P4B3HJBV20YWP
  • should work with react rendering in step
  • promiseAllWorkflow | wrun_01KX1SYCN9KZ7Q5VEWCXBA6WBF
  • promiseRaceWorkflow | wrun_01KX1SYHERJJBAFQA05PJGZ3A7
  • promiseAnyWorkflow | wrun_01KX1SYKGNNPEZB45E3R6N8DP3
  • importedStepOnlyWorkflow | wrun_01KX1T0HCENSW9YQGTKT9RESVS
  • readableStreamWorkflow | wrun_01KX1SYNJEG7NK65BCCS1HSYVH
  • hookWorkflow | wrun_01KX1T0033HMSTBHSG9ZJYCY5G
  • hookWorkflow is not resumable via public webhook endpoint | wrun_01KX1T092XD83FY7F9X5847XTY
  • webhookWorkflow | wrun_01KX1T0DD1FMZT22TD3CB2KXMQ
  • parallelStepsThenWebhookWorkflow - no hook_conflict from same-tick replay race | wrun_01KX1T0KF0G0CF3HY2BSY0MPD2
  • sleepingWorkflow | wrun_01KX1T1KK73D4QEFY8HSAZT6JP
  • parallelSleepWorkflow | wrun_01KX1T22QAB1Z1MG89AFHM6YJE
  • sleepWinsRaceWorkflow | wrun_01KX1T25ZFWMXQAFNWP55EAZR4
  • stepWinsRaceWorkflow | wrun_01KX1T295VRHXPF6A18DP5NF8C
  • nullByteWorkflow | wrun_01KX1T2CBKC1Y1BDNE8BCJWHBC
  • workflowAndStepMetadataWorkflow | wrun_01KX1T2EM0J82GC89A83KEQ8T1
  • outputStreamWorkflow no startIndex (reads all chunks)
  • outputStreamWorkflow positive startIndex (skips first chunk)
  • outputStreamWorkflow negative startIndex (reads from end)
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns correct index after stream completes
  • outputStreamWorkflow - getTailIndex and getStreamChunks getTailIndex returns -1 before any chunks are written
  • outputStreamWorkflow - getTailIndex and getStreamChunks getStreamChunks returns same content as reading the stream
  • outputStreamInsideStepWorkflow - getWritable() called inside step functions | wrun_01KX1T4WAH64FK6Q06D1H2FQ81
  • writableForwardedFromWorkflowWorkflow | wrun_01KX1T5CDS1GK44CFFHA9N8SES
  • writableForwardedFromStepWorkflow | wrun_01KX1T5JRCFDT28YDWD2R90FR9
  • fetchWorkflow | wrun_01KX1T5RZVA3BJFNS1HNSKC32G
  • promiseRaceStressTestWorkflow | wrun_01KX1T5W5X919Z2Q83CK04FBXD
  • error handling error propagation workflow errors nested function calls preserve message and stack trace
  • error handling error propagation workflow errors cross-file imports preserve message and stack trace
  • error handling error propagation step errors basic step error preserves message and stack trace
  • error handling error propagation step errors cross-file step error preserves message and function names in stack
  • error handling retry behavior regular Error retries until success
  • error handling retry behavior FatalError fails immediately without retries
  • error handling retry behavior RetryableError respects custom retryAfter delay
  • error handling retry behavior maxRetries=0 disables retries
  • error handling catchability FatalError can be caught and detected with FatalError.is()
  • error handling not registered WorkflowNotRegisteredError fails the run when workflow does not exist
  • error handling not registered StepNotRegisteredError fails the step but workflow can catch it
  • error handling not registered StepNotRegisteredError fails the run when not caught in workflow
  • hookCleanupTestWorkflow - hook token reuse after workflow completion | wrun_01KX1T96DG186V72X0QXB45Q7F
  • concurrent hook token conflict - two workflows cannot use the same hook token simultaneously | wrun_01KX1T9HP1A3KT7ASH0DRHBY36
  • hookGetConflictWorkflow - awaiting hook.getConflict() registers hook without payload | wrun_01KX1T9XQVWG94TXACW42JJ5EZ
  • 'hookGetConflictWithPriorStepWorkflow' - hook.getConflict() does not block step execution | wrun_01KX1TA0A5CJPJFE4AVX92DBXM
  • 'hookGetConflictWithParallelStepWorkfl…' - hook.getConflict() does not block step execution | wrun_01KX1TA30FTH17VRRG9QAMAFB1
  • hookGetConflictThenStepParallelWorkflow - hook.getConflict() continuation step runs alongside other steps | wrun_01KX1TA5NYHXACA433Q4JWZ012
  • hookGetConflictWorkflow - hook.getConflict() resolves with the conflicting run when token is already registered | wrun_01KX1TAKGMZJ0QJCG5MPTR5K8S
  • hookClaimOnlyMutexWorkflow - hook works as a pure run mutex without payload data | wrun_01KX1TBDJ2VM2VRW38F3JDGX9D
  • hookAdoptOwnerResultWorkflow - duplicate adopts the owner result via conflict.returnValue | wrun_01KX1TBJNZ61VHWRQY8T3WW97T
  • hookSignalOwnerWorkflow - duplicate forwards its payload to the owner via resumeHook | wrun_01KX1TBRC6XWAYE8QNS266C802
  • hookSupersedeOwnerWorkflow - duplicate cancels the owner and claims the released token | wrun_01KX1TBXRY8296WF8MCNKGDA5F
  • resume-or-start route pattern - resumeHook retried after start() reaches the new run | wrun_01KX1TC67K0PDVB4P76AB2KG18
  • hookDisposeTestWorkflow - hook token reuse after explicit disposal while workflow still running | wrun_01KX1TCDC9P6HR5876XV8YTSCM
  • stepFunctionPassingWorkflow - step function references can be passed as arguments (without closure vars) | wrun_01KX1TCWPA20GZXFHQ44TFBQF1
  • stepFunctionWithClosureWorkflow - step function with closure variables passed as argument | wrun_01KX1TD5A0DXQJC2FH4MHZGGJS
  • closureVariableWorkflow - nested step functions with closure variables | wrun_01KX1TDC5JE9D7MHNCSR3SMHK2
  • spawnWorkflowFromStepWorkflow - spawning a child workflow using start() inside a step | wrun_01KX1TDEMPDSGNV0SWWE51E0TC
  • health check (queue-based) - workflow and step endpoints respond to health check messages
  • health check (CLI) - workflow health command reports healthy endpoints
  • pathsAliasWorkflow - TypeScript path aliases resolve correctly | wrun_01KX1TE1QJ032TC0GZE6KYFHEB
  • Calculator.calculate - static workflow method using static step methods from another class | wrun_01KX1TE7GP05JE8PKNHK6W3GSA
  • AllInOneService.processNumber - static workflow method using sibling static step methods | wrun_01KX1TEE05EF9XC01TC8PG16NX
  • ChainableService.processWithThis - static step methods using this to reference the class | wrun_01KX1TEMP4RRBKC6V7VGTWXY0Y
  • thisSerializationWorkflow - step function invoked with .call() and .apply() | wrun_01KX1TEV45WP8KVP17Z06EES2D
  • customSerializationWorkflow - custom class serialization with WORKFLOW_SERIALIZE/WORKFLOW_DESERIALIZE | wrun_01KX1TF1R229DT7Y5QY90W5G9B
  • instanceMethodStepWorkflow - instance methods with "use step" directive | wrun_01KX1TF8CWGDHF583VWS4M6Y91
  • crossContextSerdeWorkflow - classes defined in step code are deserializable in workflow context | wrun_01KX1TFN5AMH6FX2WY72K57KXD
  • stepFunctionAsStartArgWorkflow - step function reference passed as start() argument | wrun_01KX1TFYD6NMBBZZY71ZNXTDAA
  • cancelRun - cancelling a running workflow | wrun_01KX1TG53FDHC70N7ECWM51BV6
  • cancelRun via CLI - cancelling a running workflow | wrun_01KX1TG9VEZTVS7Z1PAMKVQKYE
  • pages router addTenWorkflow via pages router
  • pages router promiseAllWorkflow via pages router
  • pages router sleepingWorkflow via pages router
  • hookWithSleepWorkflow - hook payloads delivered correctly with concurrent sleep | wrun_01KX1TGHBA83VMXH6ZMT6M7A22
  • hookWithSleepFinalStepWorkflow - step only on final payload | wrun_01KX1TGWZ660X3MPCMM2Y18VRK
  • sleepInLoopWorkflow - sleep inside loop with steps actually delays each iteration | wrun_01KX1TH56Q8NDZ28JX6B8P414D
  • sleepWithSequentialStepsWorkflow - sequential steps work with concurrent sleep (control) | wrun_01KX1THGS1WC40Y01A9AEMP4CK
  • importMetaUrlWorkflow - import.meta.url is available in step bundles | wrun_01KX1THRXTK9PS7V661GGPKM4V
  • metadataFromHelperWorkflow - getWorkflowMetadata/getStepMetadata work from module-level helper (#1577) | wrun_01KX1THV0A4K36CFT6K5RAC8PT
  • resilient start: addTenWorkflow completes when run_created returns 500 | wrun_01KX1THX1X0P49CYJJJB501RVG

Details by Category

❌ ▲ Vercel Production
App Passed Failed Skipped
❌ astro 96 1 8
❌ example 96 1 8
❌ express 96 1 8
❌ fastify 96 1 8
❌ hono 96 1 8
❌ nextjs-turbopack 101 1 3
❌ nextjs-webpack 101 1 3
❌ nitro 96 1 8
❌ nuxt 96 1 8
❌ sveltekit 96 1 8
❌ vite 96 1 8
✅ 💻 Local Development
App Passed Failed Skipped
✅ astro-stable 99 0 6
✅ express-stable 99 0 6
✅ fastify-stable 99 0 6
✅ hono-stable 99 0 6
✅ nextjs-turbopack-canary 86 0 19
✅ nextjs-turbopack-stable 105 0 0
✅ nextjs-webpack-canary 86 0 19
✅ nextjs-webpack-stable 105 0 0
✅ nitro-stable 99 0 6
✅ nuxt-stable 99 0 6
✅ sveltekit-stable 99 0 6
✅ vite-stable 99 0 6
✅ 📦 Local Production
App Passed Failed Skipped
✅ astro-stable 99 0 6
✅ express-stable 99 0 6
✅ fastify-stable 99 0 6
✅ hono-stable 99 0 6
✅ nextjs-turbopack-canary 86 0 19
✅ nextjs-turbopack-stable 105 0 0
✅ nextjs-webpack-canary 86 0 19
✅ nextjs-webpack-stable 105 0 0
✅ nitro-stable 99 0 6
✅ nuxt-stable 99 0 6
✅ sveltekit-stable 99 0 6
✅ vite-stable 99 0 6
❌ 🐘 Local Postgres
App Passed Failed Skipped
✅ astro-stable 99 0 6
✅ express-stable 99 0 6
✅ fastify-stable 99 0 6
✅ hono-stable 99 0 6
✅ nextjs-turbopack-canary 86 0 19
✅ nextjs-turbopack-stable 105 0 0
✅ nextjs-webpack-canary 86 0 19
✅ nextjs-webpack-stable 105 0 0
✅ nitro-stable 99 0 6
✅ nuxt-stable 99 0 6
❌ sveltekit-stable 98 1 6
✅ vite-stable 99 0 6
✅ 🪟 Windows
App Passed Failed Skipped
✅ nextjs-turbopack 105 0 0
❌ 🌍 Community Worlds
App Passed Failed Skipped
✅ mongodb-dev 3 0 3
✅ redis-dev 3 0 3
❌ redis 67 19 0
✅ turso-dev 3 0 3
❌ turso 3 83 0
✅ 📋 Other
App Passed Failed Skipped
✅ e2e-local-dev-nest-stable 99 0 6
✅ e2e-local-dev-tanstack-start-stable 99 0 6
✅ e2e-local-postgres-nest-stable 99 0 6
✅ e2e-local-postgres-tanstack-start-stable 99 0 6
✅ e2e-local-prod-nest-stable 99 0 6
✅ e2e-local-prod-tanstack-start-stable 99 0 6

📋 View full workflow run


Some E2E test jobs failed:

  • Vercel Prod: failure
  • Local Dev: success
  • Local Prod: success
  • Local Postgres: failure
  • Windows: success

Check the workflow run for details.

Signed-off-by: Nathan Colosimo <110621881+NathanColosimo@users.noreply.github.com>
@vercel vercel Bot temporarily deployed to Preview – workflow-docs July 8, 2026 21:24 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants